# Contributor: ScrumpyJack <scrumpyjack@st.ilet.to>
# Maintainer: ScrumpyJack <scrumpyjack@st.ilet.to>
pkgname=virtualgl
_pkgname=VirtualGL
pkgver=2.6.4
pkgrel=0
pkgdesc="VirtualGL is a toolkit to run remote OpenGL applications with full 3D hardware acceleration."
url="https://virtualgl.org/"
arch="x86_64 ppc64le"
license="LGPL-2.1-or-later"
makedepends="mesa-dev cmake openssl-dev libjpeg-turbo-dev libx11-dev glu-dev libxv-dev
	xcb-util-keysyms-dev libxtst-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://downloads.sourceforge.net/project/virtualgl/$pkgver/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	mkdir -p build && cd build

	cmake .. \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_DOCDIR=/usr/share/doc/$pkgname \
		-DCMAKE_INSTALL_LIBDIR=/usr/lib \
		-DCMAKE_INSTALL_BINDIR=/usr/bin \
		-DTJPEG_INCLUDE_DIR=/usr/include \
		-DTJPEG_LIBRARY=/usr/lib/libturbojpeg.so \
		-DOPENGL_glu_LIBRARY=/usr/lib/libGLU.so \
		-DVGL_USESSL=1 \
		-DVGL_FAKEXCB=1 \
		-DVGL_FAKEOPENCL=0
	make
}

package() {
	cd "$builddir/build"
	make  DESTDIR="$pkgdir" install
}

sha512sums="a475e5b7373d0c86ec7d1274f7527cd7bb1d82acdb38d42366faae58175052f957e090a4c8fdb4e3ba4b2b9063957c14b46d55316b69420247d2f9cf3afb1280  VirtualGL-2.6.4.tar.gz"
